import _mm from "util/mm";
import _all from "service/all-service";
import tool from "util/tool";

require('./index.css');

const page = {
    init() {
        this.initMenu();
        this.bindEvent();
    },
    initMenu() {
        _all.getIndexAllType(res => {
            const page = require('./rightMenu.string');
            $('.ser-list').html(_mm.renderHtml(page, {data: res.data}));
        }, err => {
            tool.msgShakeLayer(err.message);
        })
    },
    bindEvent() {
        const goTo = function () {
            // debugger;
            tool.pushNode($(this));
        };
        $(document).on('click', '.item-click', goTo);
    }
};

module.export = page.init();